<!--App.vue是前端渲染的入口-->
<template>
  <!--导航-->
  <nav>
    <router-link to="/">Home早上好</router-link><br>
    <router-link to="/about">About中午好</router-link><br>
    <router-link to="/a">文本指令</router-link> <br>
    <router-link to="/b">属性绑定指令</router-link><br>
    <router-link to="/c">双向绑定指令</router-link><br>
    <router-link to="/d">事件绑定指令</router-link><br>
    <router-link to="/e">循环指令</router-link><br>
    <router-link to="/f">隐藏显示指令</router-link><hr>
    <router-link to="/g">计算器练习</router-link> |
    <router-link to="/h">猜数字练习</router-link> |
    <router-link to="/i">员工列表练习</router-link> |
    <router-link to="/j">个人简历练习</router-link> |
    <router-link to="/k">按钮组件</router-link> |
    <router-link to="/l">图标组件</router-link> |
    <router-link to="/m">消息提示组件</router-link> |
    <router-link to="/n">单选组件</router-link> |
    <router-link to="/o">下拉选框组件</router-link> |
    <router-link to="/p">开关组件</router-link> |
    <router-link to="/q">表单组件</router-link> |
    <router-link to="/r">表格组件</router-link> |
    <router-link to="/s">菜单组件</router-link> |<hr>
    <router-link to="/t">分栏布局组件</router-link> |
    <router-link to="/u">容器布局组件</router-link> |
    <router-link to="/v">轮播图组件</router-link> |
    <router-link to="/w">卡片组件</router-link> |
    <router-link to="/x">日期时间选择器组件</router-link> |
    <router-link to="/y">员工列表综合练习</router-link> |
    <router-link to="/z">商品综合练习</router-link> |
  </nav>
  <hr>
  <!--可变区域：随着不同的路由路径加载不同的vue组件-->
  <router-view/>
</template>

<script>
/*解决ResizeObserver Error*/
const debounce = (fn, delay) => {
  let timer = null;
  return function () {
    let context = this;
    let args = arguments;
    clearTimeout(timer);
    timer = setTimeout(function () {
      fn.apply(context, args);
    }, delay);
  }
}

const _ResizeObserver = window.ResizeObserver;
window.ResizeObserver = class ResizeObserver extends _ResizeObserver{
  constructor(callback) {
    callback = debounce(callback, 16);
    super(callback);
  }
}

</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

nav {
  //padding: 30px;
}

nav a {
  font-weight: bold;
  color: #2c3e50;
  text-decoration: none;
}

nav a.router-link-exact-active {
  color: #42b983;
}
</style>
<script setup>
</script>